<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>计算器</title>
		<style>
			[v-cloak]{
				display: none;
			}
		</style>
	</head>
	<body>
		<div id="app">		
				数据1:<input type="text" v-model="num1"/><br />
				数据2:<input type="text" v-model="num2" @keyup.enter="sum"/>&nbsp;&nbsp;<button @click="sum()">计算</button><br />
				<a v-cloak>总数:{{count}}</a>
		</div>
		<script src="../js/vue.js"></script>
		<script>
			const app = new Vue({
				el:"#app",
				data:{
					num1:'',
					num2:'',
					count:''
				},
				methods:{
					sum(){
						this.count=parseFloat(this.num1)+parseFloat(this.num2)
					}
				}
			})
		</script>
	</body>
</html>
